Skip to content

Conversation

@moulikagarwal
Copy link
Contributor

@moulikagarwal moulikagarwal commented Jan 24, 2026

Make Service Attachment's target_service field as Mutable. This allows for update of google_compute_service_attachment resource with target_service to happen In-place and not a recreate (destroy & create).

Fixes hashicorp/terraform-provider-google#25899

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

compute: updated `target_service` field to be mutable in `google_compute_service_attachment` resource

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 24, 2026
@github-actions github-actions bot requested a review from NickElliot January 24, 2026 01:32
@github-actions
Copy link

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@NickElliot, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@moulikagarwal moulikagarwal changed the title Allow service attachment to update target service as mutable update Allow PSC Service Attachment to update target_service as a mutable update Jan 25, 2026
@modular-magician modular-magician added service/private-service-connect-published-service and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Jan 26, 2026
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 152 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 2 files changed, 152 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1330
Passed tests: 1241
Skipped tests: 86
Affected tests: 3

Click here to see the affected service packages
  • compute

Action taken

Found 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeServiceAttachment_serviceAttachmentBasicExampleUpdate
  • TestAccComputeServiceAttachment_targetServiceInPlaceUpdate
  • TestAccComputeServiceAttachment_tunnelingConfigUpdate

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeServiceAttachment_serviceAttachmentBasicExampleUpdate [Debug log]
TestAccComputeServiceAttachment_tunnelingConfigUpdate [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccComputeServiceAttachment_targetServiceInPlaceUpdate [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

Copy link
Contributor

@NickElliot NickElliot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test is failing with the following:

 resource_compute_service_attachment_test.go:134: Step 1/3 error: Error running pre-apply refresh: exit status 1
        
        Error: Invalid expression
        
          on terraform_plugin_test.tf line 95, in resource "google_compute_service_attachment" "psc_attachment":
          95:   target_service = %{target_key == "l4ilb" ? "google_compute_forwarding_rule.producer_l4_ilb_fr.id" : "google_compute_forwarding_rule.producer_l7_ilb_forwarding_rule.id"}
        
        Expected the start of an expression, but found an invalid expression token.
    testing_new.go:79: Error retrieving state, there may be dangling resources: exit status 1
        
        Error: Invalid expression
        
          on terraform_plugin_test.tf line 95, in resource "google_compute_service_attachment" "psc_attachment":
          95:   target_service = %{target_key == "l4ilb" ? "google_compute_forwarding_rule.producer_l4_ilb_fr.id" : "google_compute_forwarding_rule.producer_l7_ilb_forwarding_rule.id"}
        
        Expected the start of an expression, but found an invalid expression token.

Have you ran the tests locally? It helps make the review faster if you can verify that instead of waiting for CI debug results

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 27, 2026
@github-actions github-actions bot requested a review from NickElliot January 27, 2026 17:01
@moulikagarwal
Copy link
Contributor Author

Latest test run are now passing

@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 28, 2026
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 155 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 2 files changed, 155 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1330
Passed tests: 1243
Skipped tests: 86
Affected tests: 1

Click here to see the affected service packages
  • compute

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeServiceAttachment_targetServiceInPlaceUpdate

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeServiceAttachment_targetServiceInPlaceUpdate [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

Copy link
Contributor

@NickElliot NickElliot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! thank you for the quick iteration

@NickElliot NickElliot added this pull request to the merge queue Jan 28, 2026
Merged via the queue into GoogleCloudPlatform:main with commit 598e4df Jan 28, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable target_service update of google_compute_service_attachment and making it a mutable field

3 participants